home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Panorama / Panorama - Disk 19D (1987-07-22)(Pacific North-West Amigas Club)[WB].zip / Panorama - Disk 19D (1987-07-22)(Pacific North-West Amigas Club)[WB].adf / TCB / TCB.doc < prev   
Text File  |  1987-03-18  |  7KB  |  144 lines

  1. *******************************
  2. * Documentation File: TCB.doc *
  3. *   15 July 1987, Al Aburto   *
  4. *   CompuServe ID: 76450,23   *
  5. *******************************
  6.  
  7.    This is a program (TCB) I wrote to help me understand Exec Tasks and
  8. AmigaDOS Processes.  The program grew as I learned,  so it can stand a bit
  9. of improvement in structure, and efficiency of operation, otherwise it
  10. is 'thoroughly' debugged.  However if you find any problems of any kind
  11. please let me know and I'll fix them.
  12.  
  13.    The Program (TCB), the Assembly Source Code (TCB.asm), and this
  14. documentation file (TCB.doc) are given to the Public Domain for use by
  15. ANYONE free of any charge by the author.  Therefore it would be a bit 'tacky'
  16. to take this code (as is) and sell it for profit.
  17.  
  18.    This program runs from the AmigaDOS CLI and it should work properly (If
  19. I did my homework correctly) from Matt Dillions 'Shell' (csh) and the
  20. MetaComCo Shell.
  21.  
  22.    A List of program commands is printed by typing: 'TCB ?<cr>' from the
  23.    CLI.  To save wear and tear on the disk drive, copy the program to RAM:
  24.    and run the program from the RAM DISK.
  25.  
  26.    A brief description of the program commands and outputs follows:
  27.  
  28.    ( 1) TCB ?<cr>
  29.         Prints a list of program commands.
  30.  
  31.    ( 2) TCB<cr>
  32.         Prints a list of all Tasks/Processes which are Running or Waiting to
  33.         Run.  The Task Name, Type, State, and Priority are printed.  An
  34.         indication is given if the Task was run from the CLI or not.  The
  35.         address of the Task Structure is also given (Task CB).  If the Task
  36.         is also a Process then the SegArray address ( pr_SegList(A0) ) is
  37.         also given where A0 points to the Process Structure.  The Initial
  38.         pointers to the Tasks was obtained from the ExecBase structure
  39.         ( defined in 'execbase.i' ) .
  40.         The definition of the SegArray ( from The AmigaDOS Manual ) is a bit
  41.         unclear.  I think I understand it correctly except for the
  42.         'Workbench' process which does not follow the same rules as other
  43.         processes ---the third element in SegArray points to resident code
  44.         --- it doesn't point to a SegList as for other processes.
  45.         If a Task is NOT also a Process then pr_CLI(A0) is undefined ( It
  46.         need not be zero ) where A0 points to the Process Structure defined
  47.         in 'dosextens.i'.  Also for the current CLI Process the SegList is
  48.         not defined in the SegArray (its zero) but in cli_Module(A0) where
  49.         A0 points to the CommandLineInterface Structure defined in
  50.         'dosextens.i' .  ( The Logic Flow Diagram For AmigaDOS must be
  51.         Complicated ).
  52.         Do this command several times to catch 'All' TCB known Tasks. They
  53.         Will pop in and out or be duplicated in the print out even though
  54.         new multitasking is Forbid() 'ened during the run. I didn't want to
  55.         use Disable() because this is 'Touchy' code.
  56.  
  57.    ( 3) TCB TaskName<cr>
  58.         This prints out the starting addresses and sizes of all code/data
  59.         segments belonging to a given Process as defined by the Task Name.
  60.         A Hex/ASCII dump of the first 12 bytes of code/data for each segment
  61.         is also printed.   Examples:  TCB df1:Aterm,  TCB CLI , TCB CON  .
  62.         This doesn't work for Workbench as I get a BPTR conversion error--In
  63.         this case a 256 byte Hex/ASCII dump is given from the error address.
  64.         Some programs, such as the Amiga 'Clock' program, consist of many
  65.         code/data segments and the output will scroll rapidly off the
  66.         screen in this case.  Press the 'Space Bar' to stop the output in
  67.         this case.  Press 'Back Space' to continue.  TCB checks for
  68.         TaskNames using the Exec function _LVOFinTask() --- If the TaskName
  69.         is not found it then checks the AmigaDOS rn_TaskArray Structures ---
  70.         if the TaskName is not found here either it just gives up and prints
  71.         'Task Not Found'.
  72.  
  73.    ( 4) TCB T TaskName<cr>
  74.         This does a Hex/ASCII dump of the data in the Task/Process Structure
  75.         as defined by the given Task Name.  Examples:  TCB T CLI<cr> ,
  76.         TCB T trackdisk.device<cr> ,  TCB T File System<cr> .   256 bytes
  77.         of data are printed even though the Task/Process Structures are not
  78.         this long.  The dump starts at the Task/Process Structure Start
  79.         Address.  Look at 'exec/tasks.i' for the Task Structure definition.
  80.         The CLI Process Structure (an extension of the Exec Task) is
  81.         defined in 'libraries/dosextens.i'.
  82.        
  83.    ( 5) TCB C TaskName<cr>
  84.         This does a Hex/ASCII dump of a CommandLineInterface Structure as
  85.         defined by the input Task Name.  Only works if the given Task is
  86.         also a Process and the Process was run from the CLI.
  87.       
  88.    ( 6) TCB D HexAddress<cr>
  89.         This does a 256 Byte Hex/ASCII dump beginning at the input Hex
  90.         Address.  Useful for examining segment code/data and Structures in
  91.         detail.  Forbit() and Permit() are used to prevent (hopefully)
  92.         mysterious system GURU Alerts.
  93.  
  94.    ( 7) TCB B BPTR<cr>
  95.         Converts the Hex BPTR to a Hex APTR.
  96.  
  97.    ( 8) TCB DS<cr>
  98.         This prints the starting address of the DosLibrary, RootNode,
  99.         DosInfo, rn_TaskArray, and DevList Structures.
  100.  
  101.    ( 9) TCB DL<cr>
  102.         This scans the DevList Structures and prints out starting addresses,
  103.         Type (Device, Volume, or Directory), Task address, SegList address,
  104.         and Name of these structures.
  105.         The Task and SegList pointers do not appear to be always meaningful.
  106.         There appears to be inconsistencies in these structures. If the
  107.         SegList is zero then either an invalid condition exists or the
  108.         code has not been loaded into ram.  A 'Volume' does not have a
  109.         SegList.
  110.  
  111.    (10) TCB L<cr>
  112.         This scans the Amiga Library node structures and prints out
  113.         the Library Base address (Node Base), The Library Name,
  114.         the Library negative size (where we find the Library Jump
  115.         addresses), the Library positive size, and the Library ID String.
  116.         The LIB_IDSTRING Pointer (address) is not always filled-in in the
  117.         LIB Structures.
  118.         I found that the icon.library Structure LIB_IDSTRING APTR is an
  119.         odd-numbered address --- This could cause problems ......
  120.  
  121.    (11) TCB D<cr>
  122.         This scans the Amiga Device Library node structures.  Same info
  123.         as in (10) is printed out.
  124.  
  125.    (12) TCB S SegList_HexAddress
  126.         This scans a SegList Array (an Array of TAsk code/data segments).
  127.         The SegList address (in Hex) is input .... Be careful here as an
  128.         incorrect SegList input could send the program off to Limbo and
  129.         most likely result in a system GURU Meditation (crash). A print
  130.         of the segment code/data start address and size is given. Also the
  131.         a Hex/ASCII dump of the first 12 bytes is done.
  132.  
  133.         SegList - $04  LONG  ;This Is The Code/Data Size For This Segment.
  134.         SegList + $00  BPTR  ;BPTR is to the next code/data segment. The
  135.                              ;Last Segment Has a NULL BPTR here.
  136.         SegList + $04  ----  ;Here Starts The Segment Code/Data.
  137. ***************************************************************************
  138.  
  139.    Al Aburto  76450,23
  140.    CompuServe ID: 76450,23
  141.  
  142. **************************** Das ist alles ********************************
  143.  
  144.